package com.jingfang.cloud.widget.check;


import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.util.SystemInfo;
import com.jingfang.cloud.MzContext;
import com.jingfang.cloud.MzPrefs;
import com.jingfang.cloud.constant.MzConstants;
import com.jingfang.cloud.constant.ui.Resources;
import com.jingfang.cloud.widget.main.MainComponent;
import dorkbox.systemTray.SystemTray;
import lombok.Getter;
import org.dromara.quickswing.ui.app.QSContext;
import org.dromara.quickswing.ui.app.QSWidget;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

@Getter
public class CheckWidget extends QSWidget<MzPrefs> {
    private final Object[] options = {"确定", "退出"};
    private final CheckComponent checkComponent;

    public CheckWidget(QSContext<? extends QSWidget<MzPrefs>, MzPrefs> context, String title, MzPrefs prefs) throws HeadlessException {
        super(context, title, prefs);
        if (SystemInfo.isWindows) {
            FlatLaf.setUseNativeWindowDecorations(true);
        }
        if (SystemInfo.isMacFullWindowContentSupported) {
            this.rootPane.putClientProperty("apple.awt.transparentTitleBar", true);
            this.rootPane.putClientProperty("apple.awt.windowTitleVisible", true);
            this.rootPane.putClientProperty(FlatClientProperties.MACOS_WINDOW_BUTTONS_SPACING,
                    FlatClientProperties.MACOS_WINDOW_BUTTONS_SPACING_MEDIUM);
        }
        this.setIconImages(Resources.MZ_WINDOW_ICONS);
        this.setResizable(true);
        this.setSize(350, 120);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.checkComponent = new CheckComponent(this);
        this.setContentPane(checkComponent.getContentPanel());
        this.setLocationRelativeTo(null);
    }


    @Override
    protected void preMenuBarInit(MzPrefs ddcPrefs, SplashScreen splashScreen) {

    }


}